<template>
  <div>
    <el-dialog title="编辑" :visible.sync="dialogVisibleEdit" width="30%">
      <div>
        <el-form
          ref="formBroadOrder"
          :model="broadOrderForm"
          label-width="80px"
        >
          <el-form-item label="姓名">
            <el-input v-model="broadOrderForm.contact"></el-input>
          </el-form-item>
          <el-form-item label="联系电话">
            <el-input v-model="broadOrderForm.mobile"></el-input>
          </el-form-item>
          <el-form-item label="身份证姓名">
            <el-input v-model="broadOrderForm.id_card_name"></el-input>
          </el-form-item>
          <el-form-item label="身份证号">
            <el-input v-model="broadOrderForm.id_card"></el-input>
          </el-form-item>
          <el-form-item label="地址">
            <el-input v-model="broadOrderForm.express_address"></el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="cancelEdit">取 消</el-button>
        <el-button type="primary" @click="sureEdit">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  props: ["editDetails"],
  data() {
    return {
      dialogVisibleEdit: false,
      broadOrderForm: {},
    };
  },
  watch: {
    editDetails: {
      handler(newVal) {
        this.broadOrderForm = newVal;
      },
    },
  },
  methods: {
    // 确定
    sureEdit() {
      this.$emit("sureEdit", this.broadOrderForm);
    },

    // 取消
    cancelEdit() {
      this.$emit("cancelEdit", "");
    },
  },
};
</script>
